﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace StormCoding.DIExtensions.Filter
{
    public class ImplementationTypeFilter : IImplementationTypeFilter
    {
        public ImplementationTypeFilter(IEnumerable<Type> types)
        {
            this.types = types;
        }

        internal IEnumerable<Type> types { get; private set; }
        public IImplementationTypeFilter WithAttribute<T>() where T : Attribute
        {
            types = types.Where(t =>t.HasAttribute<T>());
            return this;
        }
    }
}
